package com.cn.stepLock.event;

import com.cn.stepLock.chain.ChainEventApplication;
import com.cn.stepLock.chain.SynchronizedProcessChain;
import com.cn.stepLock.listener.OfferTaskToSynchronizedChainListener;
import com.cn.stepLock.listener.StartExecuteTaskListener;

/**
 * @author Aaron
 * @desc
 * @createTime 2022-02-24 8:46
 * @since
 */
public class OfferTaskToSynchronizedChainEvent extends BaseEvent{

    private SynchronizedProcessChain synchronizedProcessChain;
    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public OfferTaskToSynchronizedChainEvent(Object source) {
        super(source);
    }

    public OfferTaskToSynchronizedChainEvent(Object source, SynchronizedProcessChain synchronizedProcessChain) {
        super(source);
        this.synchronizedProcessChain = synchronizedProcessChain;
        addListener(ChainEventApplication.getEventListener(OfferTaskToSynchronizedChainListener.class));
    }

    public SynchronizedProcessChain getSynchronizedProcessChain() {
        return synchronizedProcessChain;
    }
}
